<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    // var a = 10;
    // var b = 3;
    // console.log(a + b);   //13 
    // console.log(a - b);   //7
    // console.log(a * b);    //30 
    // console.log(a / b);    //3.33333
    // console.log(a % b);    //1

    // var a = "10";
    // var b = 3;
    // console.log(a + b);   //103
    // console.log(a - b);    //7
    // console.log(a * b);    //30
    // console.log(a / b);    //3.3333
    // console.log(a % b);    //1
    
    // +号两边只要有一边是字符（非数值），那么运算规则就是字符串拼接
    
    // var a = "10";  
    // var b = "3";
    // console.log(a + b);   //103
    // console.log(a - b);    //7
    // console.log(a * b);    //30
    // console.log(a / b);    //3.3333
    // console.log(a % b);    //1
    
    // -,*,/,%会将两边的数据转为数值后，再做数学运算

    var a = "hello";
    var b = "world";
    console.log(a + b);    //helloworld
    console.log(a - b);    //nan
    console.log(a * b);    //nan
    console.log(a / b);    //nan
    console.log(a % b);    //nan

    // 无法转成数字的数据，会被转成NaN
    // NaN：not a number，表示非法的数值转换或运算

</script>
</html>